package com.ruoyi.ly.mapper;

import com.github.pagehelper.Page;
import com.ruoyi.ly.domain.ServeUser;
import com.ruoyi.ly.domain.dto.PageServeUserDTO;
import com.ruoyi.ly.domain.vo.PageProjectVO;
import com.ruoyi.ly.domain.vo.PageServeUserVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface ServeUserMapper {

    //分页查询管理员列表
    Page<PageServeUserVO> pageQuery(PageServeUserDTO pageServeUserDTO);

    //根据openid查询用户信息
    @Select("select * from serve_user where open_id = #{openid}")
    ServeUser selectByOpenId(String openid);

    //将新用户存入数据库
    void insert(ServeUser serveUser);

    //根据用户名获取对应openid
    @Select("select open_id from serve_user where name = #{name}")
    String selectByName(String name);
}
